<!DOCTYPE html>
<html>
<head>
    <title>GCD计算器</title>
    <style>
        body {
            font-family: Arial, sans-serif;
            max-width: 500px;
            margin: 0 auto;
            padding: 20px;
        }
        .container {
            border: 1px solid #ddd;
            padding: 20px;
            border-radius: 5px;
        }
        input, button {
            padding: 8px;
            margin: 5px 0;
        }
        button {
            background-color: #4CAF50;
            color: white;
            border: none;
            cursor: pointer;
        }
        .result {
            margin-top: 15px;
            padding: 10px;
            background-color: #f8f8f8;
            border-radius: 5px;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1>GCD计算器</h1>
        <form method="POST">
            <label for="numbers">输入数字(用逗号分隔):</label><br>
            <input type="text" id="numbers" name="numbers" placeholder="例如: 24, 36, 60"><br>
            <button type="submit">计算GCD</button>
        </form>
        
        {% if result is not none %}
        <div class="result">
            <strong>结果:</strong> 
            {% if '错误' in result %}
                {{ result }}
            {% else %}
                最大公约数是: {{ result }}
            {% endif %}
        </div>
        {% endif %}
    </div>
</body>
</html>